#include "../bs/build_serialize.hpp"

namespace message {

namespace login {

// 账号登陆消息
template<class _OUT_HELPER_T, class _IN_HELPER_T>
class bs_account_login : public build_serialize::bs_message_t<_OUT_HELPER_T, _IN_HELPER_T> {

public:
    // wolegequ
    const uint8_t& u8() const { return *u8_; }
    // wolegequ
    uint8_t& u8() { return *u8_; }
    // wolegequ
    void u8(const uint8_t& _value) { *u8_ = _value; }

    // wolegequ1
    const uint16_t& u16() const { return *u16_; }
    // wolegequ1
    uint16_t& u16() { return *u16_; }
    // wolegequ1
    void u16(const uint16_t& _value) { *u16_ = _value; }

    // wolegequ1
    const uint32_t& u32() const { return *u32_; }
    // wolegequ1
    uint32_t& u32() { return *u32_; }
    // wolegequ1
    void u32(const uint32_t& _value) { *u32_ = _value; }

    // wolegequ1
    const int8_t& i8() const { return *i8_; }
    // wolegequ1
    int8_t& i8() { return *i8_; }
    // wolegequ1
    void i8(const int8_t& _value) { *i8_ = _value; }

    // wolegequ1
    const int16_t& i16() const { return *i16_; }
    // wolegequ1
    int16_t& i16() { return *i16_; }
    // wolegequ1
    void i16(const int16_t& _value) { *i16_ = _value; }

    // wolegequ1
    const int32_t& i32() const { return *i32_; }
    // wolegequ1
    int32_t& i32() { return *i32_; }
    // wolegequ1
    void i32(const int32_t& _value) { *i32_ = _value; }

    // wolegequ1
    const int64_t& i64() const { return *i64_; }
    // wolegequ1
    int64_t& i64() { return *i64_; }
    // wolegequ1
    void i64(const int64_t& _value) { *i64_ = _value; }

    // wolegequ1
    const std::list<int8_t>& i8_array() const { return *i8_array_; }
    // wolegequ1
    std::list<int8_t>& i8_array() { return *i8_array_; }
    // wolegequ1
    void i8_array(const std::list<int8_t>& _value) { *i8_array_ = _value; }

    // wolegequ1
    const std::list<int8_t>& i8_list() const { return *i8_list_; }
    // wolegequ1
    std::list<int8_t>& i8_list() { return *i8_list_; }
    // wolegequ1
    void i8_list(const std::list<int8_t>& _value) { *i8_list_ = _value; }

    // wolegequ1
    const ydd::string& ustring() const { return *ustring_; }
    // wolegequ1
    ydd::string& ustring() { return *ustring_; }
    // wolegequ1
    void ustring(const ydd::string& _value) { *ustring_ = _value; }

    // wolegequ1
    const std::list<build_serialize::bs_ustring_u>& ustring_list() const { return *ustring_list_; }
    // wolegequ1
    std::list<build_serialize::bs_ustring_u>& ustring_list() { return *ustring_list_; }
    // wolegequ1
    void ustring_list(const std::list<build_serialize::bs_ustring_u>& _value) { *ustring_list_ = _value; }

protected:
    virtual uint32_t child_length() const {
        return u8_.length() +
            u16_.length() +
            u32_.length() +
            i8_.length() +
            i16_.length() +
            i32_.length() +
            i64_.length() +
            i8_array_.length() +
            i8_list_.length() +
            ustring_.length() +
            ustring_list_.length();
    }

    virtual bool child_serialize(_OUT_HELPER_T& _helper) const {
        return u8_.serialize(_helper) &&
            u16_.serialize(_helper) &&
            u32_.serialize(_helper) &&
            i8_.serialize(_helper) &&
            i16_.serialize(_helper) &&
            i32_.serialize(_helper) &&
            i64_.serialize(_helper) &&
            i8_array_.serialize(_helper) &&
            i8_list_.serialize(_helper) &&
            ustring_.serialize(_helper) &&
            ustring_list_.serialize(_helper);
    }

    virtual bool child_build(_IN_HELPER_T& _helper) const {
        return u8_.build(_helper) &&
            u16_.build(_helper) &&
            u32_.build(_helper) &&
            i8_.build(_helper) &&
            i16_.build(_helper) &&
            i32_.build(_helper) &&
            i64_.build(_helper) &&
            i8_array_.build(_helper) &&
            i8_list_.build(_helper) &&
            ustring_.build(_helper) &&
            ustring_list_.build(_helper);
    }

private:
     // wolegequ
    build_serialize::bs_crt_uint8 u8_ = 32;
     // wolegequ1
    build_serialize::bs_crt_uint16 u16_;
     // wolegequ1
    build_serialize::bs_crt_uint32 u32_;
     // wolegequ1
    build_serialize::bs_crt_int8 i8_;
     // wolegequ1
    build_serialize::bs_crt_int16 i16_;
     // wolegequ1
    build_serialize::bs_crt_int32 i32_;
     // wolegequ1
    build_serialize::bs_crt_int64 i64_;
     // wolegequ1
    build_serialize::bs_list_st<int8_t> i8_array_;
     // wolegequ1
    build_serialize::bs_list_st<int8_t> i8_list_;
     // wolegequ1
    build_serialize::bs_ustring_u ustring_ = "33333333333";
     // wolegequ1
    build_serialize::bs_list_ot<build_serialize::bs_ustring_u> ustring_list_;
};

} // namespace login

} // namespace message

